package org.dousb.doupicture.domain.user.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import org.dousb.doupicture.domain.user.entity.Space;
import org.dousb.doupicture.domain.user.entity.User;
import org.dousb.doupicture.interfaces.dto.space.SpaceAddRequest;
import org.dousb.doupicture.interfaces.dto.space.SpaceQueryRequest;
import org.dousb.doupicture.interfaces.vo.space.SpaceVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author Administrator
 * @description 针对表【space(空间)】的数据库操作Service
 * @createDate 2025-10-09 08:18:42
 */
public interface SpaceDomainService extends IService<Space> {

    /**
     * 校验参数
     *
     * @param space
     * @param add
     */
    void validSpace(Space space, boolean add);

    /**
     * 校验空间权限
     *
     * @param space
     * @param loginUser
     */
    void checkSpaceAuth(Space space, User loginUser);

    /**
     * 空间限额
     *
     * @param space
     */
    void fillSpaceBySpaceLevel(Space space);

    /**
     * 新增私有空间
     *
     * @param spaceAddRequest
     * @return
     */
    long addSpace(SpaceAddRequest spaceAddRequest, User loginUser);

    /**
     * 获取空间列表
     *
     * @param spaceList
     * @return
     */
    List<SpaceVO> getSpaceVOList(List<Space> spaceList);

    /**
     * 封装查询条件
     *
     * @param spaceQueryRequest
     * @return
     */
    QueryWrapper<Space> getQueryWrapper(SpaceQueryRequest spaceQueryRequest);

    /**
     * 封装返回空间类
     *
     * @param space
     * @param request
     * @return SpaceVO
     */
    SpaceVO getSpaceVO(Space space, HttpServletRequest request);
}
